package com.itheima.socket.ip.inetaddress.demo01;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressDemo01 {

    public static void main(String[] args) throws UnknownHostException {

        InetAddress inetAddress = InetAddress.getByName("DESKTOP-EUS2LR5");
        System.out.println(inetAddress);

        InetAddress inetAddress1 = InetAddress.getByName("10.254.1.56");
        System.out.println(inetAddress1);

        System.out.println(inetAddress.getHostName());
        System.out.println(inetAddress.getHostAddress());


    }

}
